package cn.yunchongbao.charging.user.controller;


import cn.yunchongbao.charging.common.pojo.JsonResult;
import cn.yunchongbao.charging.common.pojo.vo.UserInfoVo;
import cn.yunchongbao.charging.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RequestMapping("/user")
@RestController
@Api(tags = "用户接口")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/info/{userId}")
    @ApiOperation("获取用户信息")
    public JsonResult getUserInfo(@PathVariable("userId") Integer userId){
        log.debug("获取用户信息入参：{}", userId);
        UserInfoVo userInfoVo = userService.getUserInfo(userId);
        JsonResult jsonResult = JsonResult.ok(userInfoVo,"获取用户信息成功");
        return jsonResult;
    }
}
